﻿namespace KingerRobot.MexicoSailunWMS.SpiService;

internal interface IWmsOutOrderMaster
{
    /// <summary>
    /// 库位出库记录
    /// </summary>
    /// <returns></returns>
    List<POVLocationOut> GetLocaltionOutList();
    /// <summary>
    /// 出库跟踪信息
    /// </summary>
    /// <returns></returns>
    List<POVOutFollow> GetOutFollowList();
    /// <summary>
    /// 入库跟踪信息
    /// </summary>
    /// <returns></returns>
    List<POVInFollow> GetInFollowList();
    /// <summary>
    /// 完成订单
    /// </summary>
    /// <param name="task">任务信息</param>
    /// <returns></returns>
    int OutOrderFinish(POWcsTask task);
    /// <summary>
    /// 获取订单列表
    /// </summary>
    /// <param name="ids"></param>
    /// <returns></returns>
    List<POWmsOutOrderMaster> GetOutOrderMasterByIds(List<long?> ids);
    /// <summary>
    /// 得到所有订单主表
    /// </summary>
    /// <returns></returns>
    List<POWmsOutOrderMaster> GetOutOrderMasterList();
    /// <summary>
    /// 获取出库单信息
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    POWmsOutOrderMaster GetOutOrderMasterById(long id);
    /// <summary>
    /// 获取订单明细
    /// </summary>
    /// <returns></returns>
    List<POWmsOutOrderSummary> GetOutOrderSummaryList();
    /// <summary>
    /// 添加出库订单主数据
    /// </summary>
    /// <param name="priority">优先权</param>
    /// <returns></returns>
    long AddOutOrderMaster(int orderType, string outType = "", int priority = 12);

   

    /// <summary>
    /// 删除出库订单
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    int DeleteOutOderMaster(long? id);
    /// <summary>
    /// 获取订单以及订单明细
    /// </summary>
    /// <returns></returns>
    List<OutOrderMasterSummarys> GetOutOrderMasterSummaryList();

    /// <summary>
    /// 修改出库订单状态
    /// </summary>
    /// <param name="id"></param>
    /// <param name="status"></param>
    /// <returns></returns>
    int UpdateMasterStatus(long id, int status);
    /// <summary>
    /// 备份删除订单主表
    /// </summary>
    /// <param name="pOWmsOutOrderMaster"></param>
    /// <returns></returns>
    int BakAndDeleteOutOrderMaster(POWmsOutOrderMaster pOWmsOutOrderMaster);

    /// <summary>
    /// 删除并备份主从订单
    /// </summary>
    /// <param name="masterId"></param>
    /// <returns></returns>
    int BakAndDeleteOutOrderMasterAndSummary(long masterId);

    /// <summary>
    /// 通过任务删出库订单主从表
    /// </summary>
    /// <param name="task"></param>
    /// <returns></returns>
    int BakAndDeleteOutOrderByTask(POWcsTask task);
    /// <summary>
    /// 通过id删除并备份主从表
    /// </summary>
    /// <param name="masterId"></param>
    /// <param name="summaryId"></param>
    /// <returns></returns>
    int BakAndDeleteOutOrderBySummaryId(long masterId, long summaryId);
}
